﻿using CaseManagerLibrary.Log;
using CaseManagerLibrary.Models;
using PSDLib.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PSDLib.Download
{
    public delegate void UpdateDownloadProgressEventHandler(IDownloader downloader, dl_files file, int time);
    public delegate void FileDownloadCompletedEventHandler(IDownloader downloader, dl_files file);
    public delegate void ResetSessionEventHandler(IDownloader downloader, dl_files file);
    public interface IDownloader
    {
        string Id { get; set; }
        dl_files FileInfo { get; set; }
        ILog Logger { get; set; }
        IDownloadServer DownloadServer { get; set; }

        ConsoleProgressBar ProgressBar { get; set; }
        HResult Download(dl_files file);

        HResult Stop();
        void ResetSessionInfo(params object[] args);
        void FinishDownload(bool success);

        event UpdateDownloadProgressEventHandler UpdateDownloadProgress;
        event FileDownloadCompletedEventHandler FileDownloadSuccess;
        event FileDownloadCompletedEventHandler FileDownloadFail;
        event ResetSessionEventHandler ResetSession;
    }
}
